package com.fz.us.admin.dict.entity;

import com.fz.us.admin.base.entity.parent.NameEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 实体类 - 字典
 * ============================================================================
 * 版权所有 2016 。
 *
 * @author fallenpanda
 * @version 1.0 2016-07-14 。
 * ============================================================================
 */
@Entity
@Table(name="sys_dict")
public class Dict extends NameEntity {

    private static final long serialVersionUID = 1860230535724889878L;

    public Dict() {
    }

    public Dict(String name, String value, String description, int ifKey) {
        this.ifSystem = 1;
        this.name = name;
        this.value = value;
        this.description = description;
        this.ifKey = ifKey;
    }

    public Dict(String keyId, String name, String value, String description) {
        this.keyId = keyId;
        this.ifSystem = 0;
        this.name = name;
        this.value = value;
        this.description = description;
        this.ifKey = 0;
    }

    /**
     * 关联Id
     */
    private String keyId;
    /**
     * 是否系统设置 1/0
     */
    private int ifSystem;
    /**
     * 关键字
     */
    private String value;
    /**
     * 描述
     */
    private String description;
    /**
     * 是否关键字典（不显示）1/0
     */
    private int ifKey;

    public String getKeyId() {
        return keyId;
    }

    public void setKeyId(String keyId) {
        this.keyId = keyId;
    }

    @Column(updatable = false)
    public int getIfSystem() {
        return ifSystem;
    }

    public void setIfSystem(int ifSystem) {
        this.ifSystem = ifSystem;
    }

    @Column(nullable = false, unique = true)
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Column(length = 5000)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getIfKey() {
        return ifKey;
    }

    public void setIfKey(int ifKey) {
        this.ifKey = ifKey;
    }

}
